package com.gome.oa.custom;

import javax.swing.RowFilter;
import javax.swing.table.TableModel;

/**
 *
 * @author: tang li
 * @date: 2016年8月21日
 * @desc: 
 *
 */
public class FormRowFilter extends RowFilter<TableModel, Integer> {
	
	private boolean showAll;
	
	public FormRowFilter(boolean showAll) {
		super();
		this.showAll = showAll;
	}

	@Override
	public boolean include(javax.swing.RowFilter.Entry<? extends TableModel, ? extends Integer> entry) {
		CustomCheckbox checkbox = (CustomCheckbox)entry.getValue(0);
        if(showAll || checkbox.getDay() == null || checkbox.getDay().getHour() > 0) {
        	checkbox.setVisableInRow(true);
        	return true;
        }
        checkbox.setVisableInRow(false);
        return false;
	}

}
